@model EIMS.Models.Department

@{
    ViewData["Title"] = "编辑部门";
}

<div class="container-fluid px-4">
    <h1 class="mt-4">@ViewData["Title"]</h1>
    <ol class="breadcrumb mb-4">
        <li class="breadcrumb-item"><a asp-controller="Home" asp-action="Index">首页</a></li>
        <li class="breadcrumb-item"><a asp-controller="Departments" asp-action="Index">部门管理</a></li>
        <li class="breadcrumb-item active">编辑部门</li>
    </ol>
    
    <div class="card mb-4">
        <div class="card-header">
            <i class="fas fa-edit me-1"></i>
            编辑部门信息
        </div>
        <div class="card-body">
            <form asp-action="Edit" method="post">
                <div asp-validation-summary="ModelOnly" class="text-danger"></div>
                <input type="hidden" asp-for="Id" />
                <input type="hidden" asp-for="CreatedAt" />
                
                <div class="row mb-3">
                    <div class="col-md-6">
                        <div class="form-group">
                            <label asp-for="Name" class="control-label"></label>
                            <input asp-for="Name" class="form-control" />
                            <span asp-validation-for="Name" class="text-danger"></span>
                        </div>
                    </div>
                </div>
                
                <div class="row mb-3">
                    <div class="col-md-12">
                        <div class="form-group">
                            <label asp-for="Description" class="control-label"></label>
                            <textarea asp-for="Description" class="form-control" rows="3"></textarea>
                            <span asp-validation-for="Description" class="text-danger"></span>
                        </div>
                    </div>
                </div>

                <div class="form-group mb-3">
                    <div class="row">
                        <div class="col-md-6">
                            <div class="form-group">
                                <label class="control-label">创建时间</label>
                                <input class="form-control" value="@Model.CreatedAt.ToString("yyyy-MM-dd HH:mm:ss")" readonly />
                            </div>
                        </div>
                    </div>
                </div>
                
                <div class="form-group">
                    <a asp-action="Index" class="btn btn-secondary">返回列表</a>
                    <button type="submit" class="btn btn-primary">
                        <i class="fas fa-save me-1"></i> 保存
                    </button>
                </div>
            </form>
        </div>
    </div>
</div>

@section Scripts {
    @{await Html.RenderPartialAsync("_ValidationScriptsPartial");}
} 